The App object

This is the root object that represents the MyAlbum application itself.

Note: For case-sensitive languages like JScript, make sure you type App and not app.

Properties:

VersionStringread-onlyThe version of the running MyAlbum application.
VisibleBooleanread-writeShows or hides the application.
nbAlbumlongread-onlyNumber of open albums.
nJPEGQualityshortread-writeQuality (0..100) when saving a JPEG file.
bJPEGProgresivebooleanread-writeSaves JPEG using progressive encoding.
nMultiXshortread-writeNumber of pictures in a row in multi-display mode.
nMultiYshortread-writeNumber of pictures in a column in multi-display mode.
nMultiPercentageshortread-writeRelative size of the picture in multi-display mode.
nMarginLeftlongread-writeSize of the left margin (mm) when printing.
nMarginRightlongread-writeSize of the right margin (mm) when printing.
nMarginToplongread-writeSize of the top margin (mm) when printing.
nMarginBottomlongread-writeSize of the bottom margin (mm) when printing.
nSlideSizePrtlongread-writeSize of the thumbnail (mm) when printing.
sFontPrinterThumbnailStringread-writeFont used when printing the thumbnails.
sFontPrinterTitleStringread-writeFont used when printing the page title.
sFontPrinterFooterStringread-writeFont used when printing the page footer.
nbMAXlongread onlyNumber of loaded MAX extension.
nUseNavigationlongread-writeNavigation flags (see below).
nStatelongread onlyState of the application (STATE_NONE=0, STATE_ALBUM=1, STATE_FULLVIEW=2, STATE_PLAYING=4).
bMultiModeBooleanread-writeSet or clear the multi-display mode.
nMultiSubModeLongread-writeSelect the mode of the multi-display.
StatusBarTextStringread-writeThe text displayed at the bottom of the main window.
nSlideshowModeLongread-onlyThe current display / slideshow mode (use the SS_xxx constants described below).
sInfoStringread-writeString for storing temporary info.
lLastKeyPressedlongread-writeCode of the last key pressed in the application (thumbnail view or full-screen view): the lower word contains the virtual-key code of the key (VK_xxx constants) and bit 0x00010000 is set if the Shift key is also pressed, bit 0x00020000 for the Ctrl key and bit 0x00040000 for the Alt key. Modifying this property has no effect.
nStretchModeLongread-writeMode used for resizing the pictures when converting pictures and generating the thumbnails (see Resizing modes in the Album object page).
sScriptFileStringread-onlyThe filename of the currently running script (if any).
sDateTimeFormatStringread-writeThe format of the date / time.

Methods:

LoadAlbum(pszFileName As String) As Object
Loads the specified album.

GetAlbum(long numAlbum) As Object
Retrieves an open album (first is 0).

GetCurrentAlbum() As Object
Retrieves the current album.

NewAlbum() As Object
Creates a new empty album.

Trace(pszMsg As String, [optional] crColor as Long, [optional] uIcon as Long )
Displays the specified string in the trace window. Text color can be changed with the crColor parameter and an icon can be displayed at the begining of the line (use the TRACE_xxx constants described below).
Optional parameters:
    crColor = -1 (use default script color),
    uIcon = -1 (no icon).

ClearTrace()
Clears the trace window.

HTMLFileName(sFile As String, sBasePathName As String, [optional] bData as Boolean) As String
Constructs a web compatible path name for a file. A relative path will be built, if possible, using the folder specified by the sBasePathName parameter (the folder of the album file is usually used there).
Characters that should not appear in a URL are escaped (' ' -> %20 for instance).
If bData is True, characters like & = or ? are also escaped.
Optional parameter: bData = False.

ConvertString(sString As String, nType as Integer) As String
Convert the string to the another coding. In this version, the nType parameter is ignored (and should be 0) and the string is converted to UTF-8.

Run(pszCommand As String, bIsFile As Boolean, nMode As Long) As Long
Starts an application (bIsFile=False) or open a file using its associated application (bIsFile=True). nMode: bits 0-3 are for the new window state (Windows SW_xxx constants): 0:hidden, 1:Normal, 2:minimize, 3:maximized, 4:inactive. Bit 16 specifies if the application will be run synchronously with MyAlbum (1) i.e. MyAlbum will wait for the application to terminate or asynchronously (0).
The return value is 0 if the command has been launched (for a synchronous command, it contains the exit code).

TimeToString(lDate As Long, nDateType As Long, [optional] sFormat as String ) As String
Converts a date or time value to a string. For the nDateType parameter, use the CF_DATE (1) or CF_TIME (2) constants. Format can be specified: for instance "HH:mm:ss" for a time or "MM/dd/yyyy" for a date.
Optional parameter: sFormat = use default user format.

TimeValueToDate(lDate As Long) As Date
Convert a date or time value to a date object.

DateToTimeValue (date As Date) As Long
Convert a date object to a time/date value.

GetMAX(sMaxName as String) as Object
Retrieves the specified MAX extension.

GetMAXByNum(iMax as Long) as Object
Retrieves the specified MAX extension by its position (0..nbMAX-1)

Wait(lDelay as Long)
Waits for the specified delay (ms).

GetTickCount() As Long
Retrieves the number of milliseconds that have elapsed since the system was started.

HTMLDialog(sHTMLFile As String, sArgs As String, sDlgParam As String) As String
Opens a HTML dialog box (IE 4 must be installed).

SendMessage(bPost As Boolean, nDest As Short, uMsg As Long, wParam As Long, lParam As Long) As Long
Sends or posts a Windows message to a MyAlbum window:
  - nDest=0 Main frame of the application,
  - nDest=1 Current view of the current album,
  - nDest=2 Full-screen display window.

PlaySound(sSound As String, hMod As Long, fdwSound As Long) As Boolean
Play a sound (hMod must be 0):
  - Play a wav file specified by the sSound parameter (fdwSound=&H00020000)
  - Play a system sound when fdwSound= &H00110000:
    - sSound = 1 ASTERISK
    - sSound = 2 QUESTION
    - sSound = 3 HAND
    - sSound = 4 EXIT
    - sSound = 5 START
    - sSound = 6 WELCOME
    - sSound = 7 EXCLAMATION
    - sSound = 8 DEFAULT

DecodeBase64ToFile( sSource As String, sDestFilesSound As String) As Boolean
Decode the Base64 encoded string to a file.

HTTPGet(sURL As String, sFile As String) As Long
Retrieve a file from the Web and store it in a local file.

HTTPGetString(sURL As String) As String
Retrieve a text file from the Web and return it as a string.

GetFullScreenView() As Object
Retrieves the view used for full-screen display (or null if not in full-screen mode).

AddCustomTool( sCaption As String, sCmd As String, lVirtualKeyCode As Long, lModifiers As Long, bSave As Boolean) As Boolean
Create a new (or modify an existing) custom tool. sCaption is the string that will appear in the Tools menu. sCmd is the command to execute in the form i|cmd (i=1 for a script file, i=2 for VBScript code and i=3 for JavaScript code). lVirtualKeyCode and lModifiers define the shortcut used to start the tool. When bSave is True, the custom tool definition will be saved.

RemoveCustomTool( sCaption As String, bSave As Boolean) As Boolean
Remove an existing custom tool identified by its caption (the string that appears in the Tools menu). When bSave is True, the custom tool definition will be removed from the registry.

GetFilename( sCaption As String, nType As Long, sInitName As String, sFilter As String, lFlags As Long ) as String
Open the standard dialog box for selecting a file or a folder. Depending on the nType parameter:
  - 0: Select a file to be opened.
  - 1: Select a file to be saved (new file).
  - 2: Select a folder.
sInitName contains the initial name for opening a new file or the selected folder when selecting a folder.
sFilter specifies the list of extensions that will appear in the Files of type drop-down list.
For instance: Album file (*.alb)|*.alb|All files (*.*)|*.*|| (note the double | at the end of the filter).
sInitName may contain OFN_xxx constants.

CaptureScreen( x as Short, y as Short, w as Short, h as Short, ) As Boolean
Capture a rectangle bitmap from the screen and copy it to the Windows clipboard.


Constants:

Navigation flags:

This is a 32 bit value containing various information:

USE_SPACEBAR0x1Space bar is used in slideshow.
USE_MOUSE0x2Mouse is used in slideshow.
USE_JOYSTICK0x4Joystick is used in slideshow.
USE_SUSPENDSS0x8Screen saver is deactivated during slideshow.
USE_IGNOREERROR0x10Errors are ignored during slideshow.
USE_NOWAITFORVIDEO0x20Slideshow waits or not for the end of videos.
USE_REVERSEDROP0x40Pictures are dropped in the reverse order.
USE_NOMESSAGES0x80Most messages are not shown.
USE_FSTOPMOST0x100Full screen window is a top-most window.
USE_ALWAYSALBUMSOUND0x200Album sound command is played even in single picture display mode (normally played only in slideshow mode).

Slideshow mode:

This is a 32 bit value containing the following information:

SS_NONE0Thumbnail view mode.
SS_VIEWPIC1Single picture viewing.
SS_NORMAL2Standard slideshow.
SS_SELECTED3Slideshow of the selected picture.
SS_RANDOM4Random slideshow.
SS_AUTO0x10000Automatic slideshow.
SS_MULTI0x20000Multiple slideshow.

Trace icons:

TRACE_NONE-1 No icon.
TRACE_INFORMATION 0 Information sign
TRACE_OK 1 OK check mark
TRACE_WARNING 2 Warning sign
TRACE_ERROR 3 Error sign
TRACE_SCRIPTERROR 4 Error in a script
TRACE_QUESTION 5 Question mark
TRACE_REDDOT 6 Red dot
TRACE_GREENDOT 7 Green dot
TRACE_YELLOWDOT 8 Yellow dot
TRACE_ARROW 9 Arrow pointing to the right
TRACE_BOMB10 Bomb
TRACE_FLAGCOMPLETE11 Complete flag
TRACE_FAILURE12 Faillure sign
TRACE_POSITIVE13 Positive sign
TRACE_NEGATIVE14 Negative sign
TRACE_LIGHTON15 Lightbulb on
TRACE_LIGHTOFF16 Lightbulb off
TRACE_LOOKAT17 Look at sign
TRACE_TLRED18 Red traffic light
TRACE_TLYELLOW19 Yellow traffic light
TRACE_TLGREEN20 Green traffic light
TRACE_WAIT21 Wait sign
TRACE_UNCHECKED22 Unchecked option symbol
TRACE_CHECKED22 Checked option symbol

Font format:

String containing the following fields:
   FaceName,Height,Width,Weight,Italic,Underline,StrikeOut

With:

For instance:
   Arial,8,0,400,1,0,0
is a italicized Arial font of 8 points height.